
class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("这是继承Thread类重写过后的线程run方法");
    }
}


public class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("这是实现Runnable接口重写过后的线程run方法");
    }
    public static void main(String[] args) {
        MyThread t1 = new MyThread();
        t1.run();
    }

    public static void main1(String[] args) {
    Thread t1 = new Thread(new MyRunnable());
    t1.start();
    }
}
